#ifndef FFMuxerThread_H
#define FFMuxerThread_H

#include"ffthread.h"
extern "C"{
#include<libavformat/avformat.h>
}

class FFAPacketQueue;
class FFVPacketQueue;
class FFMuxer;
class FFAEncoder;
class FFVEncoder;
class FFPacket;

class FFMuxerThread: public FFThread
{
public:
    FFMuxerThread();
    ~FFMuxerThread() override;

    void init(FFAPacketQueue*aPktQueue_,FFVPacketQueue*vPktQueue_,FFMuxer* muxer_,FFAEncoder* aEncoder_,FFVEncoder* vEncoder_);
protected:
    virtual void run() override;

private:
    void processPacket(AVPacket *aPkt, FFPacket *aFFPkt, AVPacket *vPkt, FFPacket *vFFPkt);
private:
    FFAPacketQueue*aPktQueue = nullptr;
    FFVPacketQueue*vPktQueue = nullptr;

    FFMuxer* muxer = nullptr;

    FFVEncoder* vEncoder = nullptr;
    FFAEncoder* aEncoder = nullptr;


};

#endif // FFMuxerThread_H
